
package convenios.classes;

import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

public class ConsultaConvenioTableModel extends AbstractTableModel {

    public List<Convenio> listaConvenio;
    private String[] colunas = {"Razão Social","Nome do Responsável","Telefone Fixo"};




    public ConsultaConvenioTableModel(List<Convenio>cl){
        listaConvenio=cl;
    }

    public int getRowCount() {
        return listaConvenio.size();
    }

    public int getColumnCount() {
        return colunas.length;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        Convenio convenio = listaConvenio.get(rowIndex);
        if (columnIndex == 0) {
            return convenio.getNome();
        } else if (columnIndex == 1) {
            return convenio.getResponsavel();
        } else 
            return convenio.getFoneFixo();
              }
}
